package edu.sdust.ssmstudy.test;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import org.json.JSONObject;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class jsonParse{
    public String city;
    public Integer value;
    public JSONObject createJSONObject(String city, Integer value){
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("name",city);
        jsonObject.put("value",value);
        return jsonObject;
    }
    /*public static void main(String[] args) {

        //列表/array 数据

        *//*Map<String, String> map1 = new HashMap<String, String>();
        map1.put("city","北京");
        map1.put("city","南京");
        map1.put("city","北京");
        map1.put("city","北京");
        Map<String,Integer> map2 = new HashMap<String, Integer>();
        map2.put("value",1);
        map2.put("value",1);
        map2.put("value",1);
        map2.put("value",1);
        Map< Map<String,String>, Map<String, Integer> > mapJson = new HashMap<Map<String, String>, Map<String, Integer>>();
        mapJson.put(map1,map2);
        String s = new GsonBuilder().create().toJson(mapJson);
        System.out.println(s);*//*
        jsonParse city = new jsonParse();
        String ss = city.createJSONObject().toString();
        List<String> li = new ArrayList<String>();
        li.add(ss);
        li.add(ss);
        li.add(ss);
        String s = li.toString();
        System.out.println(s);



    }*/



}